//package com.jiezhuo.controller;
//
//import com.jiezhuo.dto.IotAlarmInfoDTO;
//import com.jiezhuo.entity.IotAlarmInfo;
//import com.jiezhuo.service.IotAlarmInfoService;
//import com.jiezhuo.utils.R;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import java.util.Date;
//
///**
// * @Author shuaigesheng
// * @Date 2022 11 04 16 31
// **/
//@RestController
//@RequestMapping("/iot-alarm-info")
//@Api(tags = "预警记录")
//public class HistoricalWarningController {
//
//    @Autowired
//    private IotAlarmInfoService iotAlarmInfoService;
//    @Resource
//
//    @ApiOperation("历史预警")
//    @GetMapping("/history")
//    public R historyAlarm(IotAlarmInfoDTO iotAlarmInfoDTO) {
//        return R.ok().code(2000).msg("查询成功").data("data", iotAlarmInfoService.earlyWarningRecord(iotAlarmInfoDTO));
//    }
//
//    @ApiOperation("报警管理")
//    @GetMapping("/alarmManagement")
//    public R alarmManagement(IotAlarmInfoDTO iotAlarmInfoDTO){
//        System.out.println(iotAlarmInfoDTO.getTriggerName());
//        return R.ok().code(2000).msg("查询成功").data("data",iotAlarmInfoService.alarmManagement(iotAlarmInfoDTO));
//    }
//
//    @ApiOperation("历史预警数量")
//    @GetMapping("/history/count")
//    public R historyAlarmCount(IotAlarmInfoDTO iotAlarmInfoDTO) {
//        return R.ok().code(2000).msg("查询成功").data("data", iotAlarmInfoService.alarmPage(iotAlarmInfoDTO));
//    }
//
//    @ApiOperation("处理报警")
//    @PostMapping("/handling/alarms")
//    public R handlingAlarms(@RequestBody IotAlarmInfo iotAlarmInfo){
//        System.out.println(iotAlarmInfo.getId());
//        iotAlarmInfo.setMtime(new Date());
//        iotAlarmInfo.setIotAlarmProcessStatus(47);
//        if(iotAlarmInfoService.updateById(iotAlarmInfo)){
//            return R.ok().code(2000).msg("成功").data("data",null);
//        }
//        return R.ok().code(4000).msg("失败").data("data",null);
//    }
//
//    @ApiOperation("未处理数据报警总数")
//    @GetMapping("/unread/count/alarm")
//    public R getAllUnReadAlarmCount(){
//        return R.ok().code(2000).msg("成功").data("data",iotAlarmInfoService.getAllAlarmCount());
//    }
//
//}
